
public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode treeNode = binaryTree.createTree();
        System.out.print("前序：");
        binaryTree.preOrder(treeNode);
        System.out.println("");
        System.out.print("中序：");
        binaryTree.inOrder(treeNode);
        System.out.println("");
        System.out.print("后序：");
        binaryTree.postOrder(treeNode);
        System.out.println("");
        System.out.print("层序：");
        binaryTree.levelOrder(treeNode);

        System.out.println("总结点的个数" + binaryTree.size1(treeNode));
        System.out.println("总结点的个数" + binaryTree.size2(treeNode));

        System.out.println("叶子结点的个数" + binaryTree.getLeafNodeCount1(treeNode));
        System.out.println("叶子结点的个数" + binaryTree.getLeafNodeCount2(treeNode));

        System.out.println("第3层的结点的个数" + binaryTree.getKLevelNodeCount(treeNode,3));

        System.out.println("二叉树的高度" + binaryTree.getHeight(treeNode));

        System.out.println("val的元素是否存在" + binaryTree.find(treeNode,'D'));

        if (binaryTree.isCompleteTree(treeNode)) {
            System.out.println("是完全二叉树");
        }else {
            System.out.println("不是完全二叉树");
        }
    }
}
